﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using Capstone_project.DatabaseAccessLayer;

namespace Capstone_project.BussnessLogicLayer
{
    class TaskBUS
    {
        ConnectData connData = new ConnectData();
        public DataTable getList()
        {
                string sql = "SELECT * FROM TASK";
                return connData.getData(sql, true);
        }
        public DataTable getDetailList()
        {
            string sql = "SELECT * FROM TASK INNER JOIN USER_TASK ON TASK.ID_TASK = USER_TASK.ID_TASK";
            return connData.getData(sql, true);
        }
        public string nextID()
        {
            string lastID = connData.getLastID("TASK", "ID_TASK").Trim();
            return Common.NextID(lastID, "TAS");
        }
    }
}
